from tortoise import fields, models
class FoundLotTradeFlow(models.Model):
    id = fields.BigIntField(pk=True)
    record_status = fields.IntField(default=1, description="记录状态:1-有效;0-无效")
    create_time = fields.DatetimeField(auto_now_add=True, description="记录创建时间")
    update_time = fields.DatetimeField(auto_now=True, description="记录修改时间")
    lot_code = fields.CharField(max_length=50, default='', description="批次号")
    found_code = fields.CharField(max_length=50, default='', description="基金编码")
    found_name = fields.CharField(max_length=200, default='', description="基金名称")
    trade_type = fields.CharField(max_length=20, default='', description="交易类型: in:买入 out:卖出")
    trade_date = fields.DateField(null=True, description="交易日期,确认份额和金额的日期")
    trade_amount = fields.DecimalField(max_digits=10, decimal_places=2, default=0.00, description="交易金额")
    trade_shares = fields.DecimalField(max_digits=10, decimal_places=2, default=0.00, description="交易份额")
    trade_si_price = fields.DecimalField(max_digits=10, decimal_places=4, default=0.0000, description="交易单价")
    trade_remark = fields.CharField(max_length=200, default='', description="交易备注:自发，策略")
    after_remark = fields.CharField(max_length=200, default='', description="后期备注")
    match_id = fields.IntField(default=0, description="核销记录ID")


    class Meta:
        table = "found_lot_trade_flow"
        table_description = "基金批次交易流水"
